package com.slowfly.rule.engine.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.slowfly.rule.engine.model.Content;
import com.slowfly.rule.engine.typehandler.JsonTypeHandler;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author shalongfei
 * @since 2024-03-06
 */
@Getter
@Setter
@TableName(autoResultMap = true)
public class Rule implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 规则名称
     */
    private String name;

    /**
     * 节点内容
     */
    @TableField(typeHandler = JsonTypeHandler.class)
    private Content content;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
